# -*- coding: utf-8 -*-
#import cgi
import json
#import time
import urllib2
from datetime import datetime,time,date
import pywintypes
# First import two useful modules
from win32com.client import Dispatch
#from adoconstants import *


ip="221.12.55.171:8889"
#http://61.153.145.162:8888/getpositionTP.asp?regnum=浙B8E792
#电信地址
#http://221.12.55.171:8889/getpositionTP.asp?regnum=浙B8E792
#网通地址
url="http://"+ip+"/getpositionTP.asp?regnum=all"
#while 1:
#print url
req = urllib2.Request(url)
response = urllib2.urlopen(req)
the_page = response.read()
s=the_page[1:len(the_page)-1]
j=json.loads(s)
#print j
for x in j:
	print x['LicensePlate']
	print x['Geometry']['Coordinates'][1]
	print x['Geometry']['Coordinates'][0]
	print x['TimeStamp']
	print x['Speed']
	print datetime.strftime(datetime.now(),"%Y/%m/%d %H:%M:%S")

